package com.huatai.datacenter.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huatai.datacenter.entity.datadesensitization.DesensitizationRuleEntity;
import com.huatai.datacenter.entity.dto.EncryDto;

import java.util.List;
import java.util.Map;

/**
 * @author gusiyi
 * @version 1.0
 * @className DesensitizationRuleService
 * @description 描述：
 * @date 2023/6/12 15:40
 */
public interface DesensitizationRuleService extends IService<DesensitizationRuleEntity> {
	/**
	 * 获取脱敏脱密规则清册
	 * @param desensitizationRuleEntity
	 * @return
	 */
	Page<DesensitizationRuleEntity> getRuleList(DesensitizationRuleEntity desensitizationRuleEntity);

	/**
	 * 根据模型id获取脱敏规则
	 * @param desensitizationRuleEntity
	 * @return
	 */
	Map<String,Object> getRuleListByDataModelIdAndFieldName(DesensitizationRuleEntity desensitizationRuleEntity);

	/**
	 * 删除脱敏脱密规则
	 * @param desensitizationRuleEntity
	 * @return
	 */
	boolean deleteByIds(List<DesensitizationRuleEntity> desensitizationRuleEntity);

	/**
	 * 通过脱敏id数组与服务数据，返回脱敏前后数据
	 * @param key 密钥
	 * @param desensitizationRuleIds 加密规则ids
	 * @param serviceData
	 * @return
	 */
	Map<String,Object> desensitizationData(JSONObject key, Long[] desensitizationRuleIds, String serviceData);
	Map<String,Object> desensitizationDatas(JSONObject key, Long[] desensitizationRuleIds, String serviceData);

	EncryDto desensitizationDataCopy(JSONObject key, Long[] desensitizationRuleIds, String serviceData,Long requrtId);
}
